<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>阶乘</title>
</head>
<body>
	<script>
		function jc (n) {
			if(n == 1){
				return 1;
			}else{
				return n * jc(n-1);
			}
		}
		console.log(jc(5));
		/*计算函数的时候除了一都会重新执行*/
	</script>
</body>
</html>